<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('项目基本信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>项目名称：</label>
                                <input type="text" name="projectName"/>
                            </li>
                            <li>
                                <label>项目编号：</label>
                                <input type="text" name="projectNo"/>
                            </li>
                            <li>
                                <label>WBS号：</label>
                                <input type="text" name="WBSNo"/>
                            </li>
                            <li>
                                <label>项目状态：</label>
                                <select name="status" th:with="type=${@dict.getType('pro_project_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}">
                                </select>
                            </li>
                            <li>
                                <label>项目类型：</label>
                                <select name="proTypeId" th:with="type=${@dict.getType('pro_project_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}">
                                </select>
                            </li>
                            <li>
                                <label>项目经理：</label>
                                <input type="text" name="pmName"/>
                            </li>
                            <li>
                                <label>所属部门：</label>
                                <input type="text" name="deptName"/>
                            </li>
                            <li>
                                <label>项目年度：</label>
                                <input type="number" name="proYear"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('project:project:edit')}]];
        var removeFlag = [[${@permission.hasPermi('project:project:remove')}]];
        var prefix = ctx + "project/project";
        // 获取数据字典数据
        var datas = [[${@dict.getType('pro_project_status')}]];
        var datas1 = [[${@dict.getType('pro_project_type')}]];

        $(function() {
            var options = {
                url: prefix + "/list",
                modalName: "项目基本信息",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'projectId', 
                    title: '项目Id',
                    visible: false
                },
                {
                    field: 'wbsno',
                    title: 'WBS号'
                },
                {
                    field: 'projectNo',
                    title: '项目编号'
                },
                {
                    field: 'projectName', 
                    title: '项目名称'
                },
                {
                    field: 'status', 
                    title: '项目状态',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(datas, value);
                    }
                },
                {
                    field: 'proTypeId',
                    title: '项目类型',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(datas1, value);
                    }
                },
                {
                    field: 'pmName',
                    title: '项目经理'
                },
                {
                    field: 'deptName', 
                    title: '部门名称'
                },
                {
                    field: 'proYear', 
                    title: '项目年度'
                },
                {
                    field: 'income', 
                    title: '收入预算'
                },
                {
                    field: 'expenditure', 
                    title: '支出预算'
                },
                {
                    field: 'procurement', 
                    title: '采购预算'
                },
                {
                    field: 'grossMargin', 
                    title: '毛利率'
                },
                {
                    field: 'outsourcingRatio', 
                    title: '外包比例'
                },
                {
                    field: 'remark', 
                    title: '备注'
                }
               ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>